const app = getApp()
Page({
  onReady: function (e) {
    // 使用 wx.createAudioContext 获取 audio 上下文 context
    this.audioCtx = wx.createAudioContext('myAudio')
  },
  data: {
    poster: '../../pages/mp3/4.jpg',
    name: '此时此刻',
    author: '许巍',
    src: '../mp3/ScanSound.mp3',
  },
  networkTap: function() {
    var self = this;
    //监听网络状态
    wx.onNetworkStatusChange(function (res) {
      if (!res.isConnected) {
        that.msg('网络似乎不太顺畅');
      }
    })
    wx.getNetworkType({
      success: function(res) {
        console.log(res);
        self.setData({
          network: '',
          network: res.networkType
        })
      },
      fail: function(err) {
        self.setData({
          network: '无法连接网络'
        })
      }
    })
  }
})